<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>活动设置</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 卡片区域 -->
    <el-card>
      <div class="text">活动设置</div>
      <div class="active">
        <div class="left-box">
          <h1>清仓大甩卖</h1>  
          <div class="time-item">     
          <span><span>{{day}}</span>天</span>
          <strong><span>{{hour}}</span>时</strong>
          <strong><span>{{minute}}</span>分</strong>
          <strong><span>{{second}}</span>秒</strong>
         </div>
        </div>
        <div class="right-box">
          <label>打折促销</label>
          <ol class="cxol">
            <li>价廉物美，挥泪抛售</li>
            <li>厂家直销，让利大众</li>
            <li>正品打折，欲购从速</li>
            <li>清仓甩卖，全场一折</li>
            <li>新货在线，折扣不断</li>
            <li>全场打折，优惠巨多</li>
          </ol>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'goodsActivity',
  components: {},
  props: {},
  data () {
    return {
      day: 0,
      hour: 0,
      minute: 0,
      second: 0
    }
  },
  computed: {
    
  },
  watch: {},
  created () {
  },
  mounted () {
    this.countdown()
    setInterval(this.countdown, 1000)
  },
  methods: { 
    countdown () {
        const endTime = +new Date('2020-8-31 0:0:0')
        const nowTime = +new Date()
        let differTime = endTime - nowTime
        differTime /= 1000
        this.day = Math.floor(differTime / 60 / 60 / 24).toString().padStart(2,0)
	      this.hour = Math.floor(differTime / 60 / 60 % 24).toString().padStart(2,0)
	      this.minute = Math.floor(differTime / 60 % 60).toString().padStart(2,0)
        this.second = Math.floor(differTime % 60).toString().padStart(2,0)
    }
  }
}
</script>

<style scoped lang="less">
.el-card{
  height: 500px;
  .text{
    margin-left: 470px;
    font-size: 40px;
  } 
  .active{
  display: flex;
  padding-top: 30px;
   justify-content: space-around;
  .left-box{
    padding: 20px;
    width: 300px;
    height: 300px;
    border: 1px solid gray;
    border-radius: 10px;
    h1{
      font-size: 30px;
      padding-left: 80px;
      padding-bottom: 30px;
    }
     .time-item {
       strong {
        background: orange;
        color: #fff;
        font-size: 26px;
        font-family: Arial;
        padding: 0 5px;
        margin-right: 10px;
        border-radius: 5px;
        box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
        }
        >span {
        float: left;
        color: orange;
        line-height: 38px;
        font-size: 22px;
        margin: 0 10px;
        font-family: Arial, Helvetica, sans-serif;
    }
     }
  }
  .right-box{
     padding: 20px;
    width: 300px;
    height: 300px;
    border: 1px solid gray;
    border-radius: 10px;
    label{
      padding-left: 120px;
    }
    .cxol{
      height: 200px;
      li{
        margin-bottom: 10px;
      }
    }
  }
}
}
</style>
